package course11;

import java.util.HashMap;
import java.util.Map;

public class Hash {
    public static void main(String[] args) {
       Map<String,Teacher>hashmap1=new HashMap<>();
       Map<String,Teacher>hashmap2=new HashMap<>();

       Teacher yebing=new Teacher();
       Teacher jiaoge=new Teacher();
       Teacher ff=new Teacher();

       yebing.setAge(18);
       yebing.setName("叶冰");
       hashmap1.put(yebing.getName(),yebing);

       jiaoge.setName("焦哥");
       jiaoge.setAge(30);
       hashmap1.put(jiaoge.getName(),jiaoge);

       ff.setName("樊凡");
       ff.setAge(20);
       hashmap2.put(ff.getName(),ff);

       String str="叶冰";
       System.out.println(hashmap1.get(str).getAge());
       System.out.println(hashmap2.get("樊凡").getName());
       Map<String,Map<String,Teacher>> hashmap4=new HashMap<>();
       hashmap4.put("pku",hashmap1);
       hashmap4.put("alibaba",hashmap2);
       System.out.println(hashmap4.get("pku").get(str).getName());
    }
}
